﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;

namespace BUS
{
    public class TheLoaiService
    {
        public static List<TheLoaiDTO> LayDanhSachTheLoai()
        {
            List<TheLoaiDTO> ListTheLoai = new List<TheLoaiDTO>();
            try
            {
                TheLoaiRepository theLoaiRep = new TheLoaiRepository();
                ListTheLoai= theLoaiRep.LayDanhSachTheLoai();
            }
            catch (System.Exception)
            { 
            }
            return ListTheLoai;
        }

        public static void ThemTheLoai(TheLoaiDTO theloaiDTO)
        {
            try
            {
                TheLoaiRepository theloaiPre = new TheLoaiRepository();
                theloaiPre.ThemTheLoai(theloaiDTO);
            }
            catch (System.Exception)
            {
            }
        }

        public static TheLoaiDTO LayThongTinTheLoai(int maTheLoai)
        {
            TheLoaiDTO theloaiDTO = new TheLoaiDTO();
            try
            {
                TheLoaiRepository theloaiRepo = new TheLoaiRepository();
                theloaiDTO = theloaiRepo.LayThongTinTheLoai(maTheLoai);
            }
            catch (System.Exception)
            {
            }
            return theloaiDTO;
        }
    }
    
}
